home *** CD-ROM | disk | FTP | other *** search
/ Word Play Farm / Word Play Farm.iso / pc / movies / shared.dxr / 00594.ls < prev    next >
Encoding:
Text File  |  1996-07-29  |  1.3 KB  |  50 lines

  1. on doButtonStuff ButtonAction, downSound, upSound
  2.   set ButtonSprite to the clickOn
  3.   set DoButtonTask to 0
  4.   set ButtonUpCast to the castNum of sprite ButtonSprite
  5.   set ButtonDownCast to ButtonUpCast + 50
  6.   set initialClickDown to 1
  7.   repeat while the stillDown
  8.     if rollOver(ButtonSprite) then
  9.       if initialClickDown = 1 then
  10.         if not downSound = 0 then
  11.           puppetSound(downSound)
  12.         end if
  13.         set initialClickDown to 0
  14.       else
  15.         nothing()
  16.       end if
  17.       set the castNum of sprite ButtonSprite to ButtonDownCast
  18.       updateStage()
  19.       set DoButtonTask to 1
  20.       next repeat
  21.     end if
  22.     set the castNum of sprite ButtonSprite to ButtonUpCast
  23.     updateStage()
  24.     set DoButtonTask to 0
  25.     if initialClickDown = 0 then
  26.       repeat while soundBusy(1)
  27.         nothing()
  28.       end repeat
  29.       if not upSound = 0 then
  30.         puppetSound(upSound)
  31.       end if
  32.       set initialClickDown to 1
  33.     end if
  34.   end repeat
  35.   if the castNum of sprite ButtonSprite = ButtonDownCast then
  36.     set the castNum of sprite ButtonSprite to ButtonUpCast
  37.     repeat while soundBusy(1)
  38.       nothing()
  39.     end repeat
  40.     if not upSound = 0 then
  41.       puppetSound(upSound)
  42.     end if
  43.     updateStage()
  44.   end if
  45.   if DoButtonTask = 1 then
  46.     do(ButtonAction)
  47.   end if
  48.   puppetSound(0)
  49. end
  50.